package com.l.d.app.library.util;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.support.annotation.NonNull;

/**
 * Created by linde on 2017/5/5.
 * <p/>
 */
public final class ContextUtil
{
    public static PackageInfo getPackageInfo(@NonNull Context context)
    {
        PackageManager manager = context.getPackageManager();
        try
        {
            return manager.getPackageInfo(context.getPackageName(), 0);
        }
        catch (PackageManager.NameNotFoundException e)
        {
            e.printStackTrace();
        }
        return null;
    }
}
